package com.weixin.open;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import com.alibaba.fastjson.JSONObject;
import com.open.util.OpensnsException;
import com.open.util.SnsNetwork;

public class WeixinApi {

	private  final static String url = "https://api.weixin.qq.com/sns/userinfo?access_token=ACCESS_TOKEN&openid=OPENID";


	public static JSONObject invoke(String access_token,String open_id) throws OpensnsException{
		String requestUrl = url.replace("ACCESS_TOKEN", access_token).replace("OPENID", open_id);
		JSONObject resp = SnsNetwork.httpsRequest(requestUrl, "GET", null);
		return resp;
	}
	
	public static void main(String[] args) throws Exception {
		Date date = new SimpleDateFormat("yyyy-MM-dd").parse("2016-04-01");
		long time1 = date.getTime();
		//1446307200000 2015-11-01
		//1448899200000 
		//1451577600000  2016-01-01
		//1459440000000 2016-04-01
		//1469980800000 2016-08-01
		System.out.println(time1);
	}
}
